package com.softtown.modules.workflow.controller;


import com.softtown.common.annotation.LogOperation;
import com.softtown.common.utils.Result;
import com.softtown.modules.workflow.dto.SwfProcPhaseDTO;
import com.softtown.modules.workflow.entity.SwfProcPhaseEntity;
import com.softtown.modules.workflow.service.SwfProcPhaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: Dingyayong
 * @Date: 2019/8/22 17:38
 * @Description:
 */
@RestController
@RequestMapping("swf/procPhase")
@Api(tags = "流程实例审批段")
public class SwfProcPhaseController {

    @Resource
    private SwfProcPhaseService swfProcPhaseService;

    /**
     * 获取该公司出差申请审批段
     *
     * @param swfProcPhaseDTO 流程实例DTO
     * @return com.softtown.common.utils.Result<java.util.List < com.softtown.modules.entity.SwfProcPhaseEntity>>
     * @Author Dingyayong
     * @Date 2020/4/13 17:20
     */
    @PostMapping("getSwfProcPhaseListBySort")
    @ApiOperation("获取该公司出差申请审批段")
    @LogOperation("获取该公司出差申请审批段")
    public Result<List<SwfProcPhaseEntity>> getSwfProcPhaseListBySort(@RequestBody SwfProcPhaseDTO swfProcPhaseDTO) {
        List<SwfProcPhaseEntity>
                swfProcPhaseEntities = swfProcPhaseService.getSwfProcPhaseListBySort(swfProcPhaseDTO);
        return new Result<List<SwfProcPhaseEntity>>().ok(swfProcPhaseEntities);
    }
}
